import React from 'react';
import {BrowserRouter, Route, Switch} from 'react-router-dom';

import MainLayout from './Page/MainLayout.js';

import CompleteTask from './Page/completeTask.js';
import UncompleteTask from './Page/uncompleteTask.js';



const BasicRoute = () => {
     return <BrowserRouter>
        <Switch>
            <Route path="/todo" component={(props)=>{
                const {match} = props;
                return <MainLayout>
                  <Route path={`${match.url}/CompleteTask`} component={() => <CompleteTask />}/>
                  <Route path={`${match.url}/UncompleteTask`} component={() => <UncompleteTask />}/>
                </MainLayout>}
             }/>
        </Switch>
    </BrowserRouter>
};


export default BasicRoute;